//   D参考代码

#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int n, w, q;

pair<pair<int, int>, int> box[MAXN]; // ((Y,X),id)
pair<pair<int, int>, int> qry[MAXN]; //               // ((T,A),id)

bool ans[MAXN];

deque<int> wait_to_del[MAXN];
int cnt = 0;
bool alive[MAXN];

int main() {
  scanf("%d%d", &n, &w);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &box[i].first.second, &box[i].first.first);
    box[i].second = i;
    alive[i] = 1;
  }
  scanf("%d", &q);
  for (int i = 1; i <= q; ++i) {
    scanf("%d%d", &qry[i].first.first, &qry[i].first.second);
    qry[i].second = i;
  }
  sort(box + 1, box + n + 1);
  sort(qry + 1, qry + q + 1);
  int ps = 1;
  for (int i = 1; i <= q; ++i) {
    int T = qry[i].first.first, A = qry[i].first.second, idx = qry[i].second;
    while (ps <= n &&
           box[ps].first.first - 1 <= T - 1) { // 将 box[ps] 设置为可删除的

      if (wait_to_del[box[ps].first.second].empty())
        ++cnt;
      wait_to_del[box[ps].first.second].push_back(box[ps].second);
      ps++;
    }
    while (cnt == w) {
      for (int j = 1; j <= w; ++j) {
        alive[wait_to_del[j][0]] = 0;
        wait_to_del[j].pop_front();
        if (wait_to_del[j].empty())
          --cnt;
      }
    }
    ans[idx] = alive[A];
  }
  for (int i = 1; i <= q; ++i) {
    puts(ans[i] ? "Yes" : "No");
  }
  return 0;
}
